#include <iostream>
#include<cstring>
#include<vector>
using namespace std;

class Point{
public:
    Point(int x,int y,const char* name)
        :_x(x)
         ,_y(y)
        ,_name(new char[strlen(name)+1]())
        {
            strcpy(_name,name);
             cout<<"Point"<<endl;
         };
    Point(const Point & other)
    :_x(other._x)
    ,_y(other._y)
    ,_name(new char[strlen(other._name)+1]())
    {
        strcpy(_name,other._name);
        cout<<"cope "<<endl;
    }
    ~Point(){
        if(_name){
            delete [] _name;
            _name = nullptr;
        }
        cout<<"~Point"<<endl;
    }
    void gets(){
        cout<<"x:"<<_x<<"y:"<<_y<<"name:"<<_name<<endl;
    }
    
private:
    int _x;
    int _y;
    char *_name;
};

int main()
{
    vector<Point> vet{{5,6,"313"},{1,5,"545"}};
    int cnt=0;
    while(1){
        vet.push_back(Point(1,2,"hkk"));
        
        cnt++;
        if(cnt==2){
            break;
        }
    }
    for(int i=0;i<4;i++){

        vet[i].gets();
    }

    std::cout << "Hello world" << std::endl;
    return 0;
}

